﻿namespace Assets.XyzCode.Fight.Game.Enemy
{
    partial class Enemy_X_Behav
    {
        /// <summary>
        /// 更新当前状态
        /// </summary>
        private void UpdateCurrState()
        {
            if (StateEnum.Stand == _currState)
            {
                if (!_standCd.IsHot())
                {
                    _currState = StateEnum.Unknown;
                }
            }
            else
            if (StateEnum.Run == _currState)
            {
                if (null == _navMeshAgent)
                {
                    return;
                }

                if (_navMeshAgent.remainingDistance <= 0.5f)
                {
                    _currState = StateEnum.Unknown;
                    DoStand(1f);
                }
            }
            else
            if (StateEnum.Wound == _currState)
            {
                if (!_woundCd.IsHot())
                {
                    _currState = StateEnum.Unknown;
                }
            }
            else
            if (StateEnum.HitAway == _currState)
            {
                if (null == _doHitAway_XC)
                {
                    _currState = StateEnum.Unknown;
                }
            }
        }
    }
}
